<!doctype html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>后台登录-X-admin2.1</title>
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />

        <link rel="stylesheet" href="./css/font.css">
        <link rel="stylesheet" href="./css/xadmin.css">
        <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
        <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="./js/xadmin.js"></script>
        <script type="text/javascript" src="./js/cookie.js"></script>
    </head>
    <body>
        <div class="x-body">
            <blockquote class="layui-elem-quote">
                特别声明：ECharts，一个纯 Javascript 的图表库，可以流畅的运行在 PC 和移动设备上，兼容当前绝大部分浏览器（IE8/9/10/11，Chrome，Firefox，Safari等），底层依赖轻量级的 Canvas 类库 ZRender，提供直观，生动，可交互，可高度个性化定制的数据可视化图表。如需使用，详细了解可以访问官网 <a href="http://echarts.baidu.com/" style="color:red">ECharts</a>。 x-admin不承担任何版权问题。
            </blockquote>
            <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
            <div id="main" style="width: 100%;height:400px;"></div>
            <blockquote class="layui-elem-quote">
                注意：本案例的Echarts图表库由cdn引入，需要在线才能正常使用，如想离线，请至Echarts官网下载。
            </blockquote>
        </div>
        <script src="//cdn.bootcss.com/echarts/3.3.2/echarts.min.js" charset="utf-8"></script>
        <script type="text/javascript">
        //查询出后台所有数据 
        $(function(){
        	var adminUser = localStorage.getItem("adminUser");
      	    adminUser = JSON.parse(adminUser);
      	    if(adminUser ==null){
	      		  parent.location.href='login.html';
	      		  return false;
      	    }
        	$.ajax({
        		url:"/meiyou/shuju/getThisWeekShujuByDate",
        		type:"post",
        		headers: {
      		        Accept: "application/json; charset=utf-8",
      		        headerId:adminUser.aId,
      		        headerToken:adminUser.token
      		    },
        		success:function(result){
        			if(result.code==100){
	        			console.log(result);
	        			var shujuList = result.extend.shujuList;
	        			var volumeNumber = shujuList.volumeNumber;
	        			var fenxiangJin = shujuList.fenxiangJin;
	        			var needData = shujuList.needData;
	        			var postReward = shujuList.postReward;
	        			var chenyijin = shujuList.chenyijin;
	        			var pingtaifei = shujuList.pingtaifei;
	        			var chongzhi = shujuList.chongzhi;
	        			var tixian = shujuList.tixian;
	        			var shipingfei = shujuList.shipingfei;
	        			var baominshu = shujuList.baominshu;
	        			var dates = shujuList.dates;
	        	        // 基于准备好的dom，初始化echarts实例
	        	        var myChart = echarts.init(document.getElementById('main'));
	
	        	        // 指定图表的配置项和数据
	        	        var option = {
	        	            title: {
	        	                text: '折线图堆叠'
	        	            },
	        	            tooltip: {
	        	                trigger: 'axis'
	        	            },
	        	            legend: {
	        	                data:['注册用户','分享金币','总发需求','悬赏金币','诚意金收益','平台费收益','充值金额','提现金额','视屏收益','报名人数']   
	        	            },
	        	            grid: {
	        	                left: '3%',
	        	                right: '4%',
	        	                bottom: '3%',
	        	                containLabel: true
	        	            },
	        	            toolbox: {
	        	                feature: {
	        	                    saveAsImage: {}
	        	                }
	        	            },
	        	            xAxis: {
	        	                type: 'category',
	        	                boundaryGap: false,
	        	                data: dates
	        	            },
	        	            yAxis: {
	        	                type: 'value'
	        	            },
	        	            series: [
	        	                {
	        	                    name:'注册用户',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:volumeNumber
	        	                },
	        	                {
	        	                    name:'分享金币',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:fenxiangJin
	        	                },
	        	                {
	        	                    name:'总发需求',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:needData
	        	                },
	        	                {
	        	                    name:'悬赏金币',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:postReward
	        	                },
	        	                {
	        	                    name:'诚意金收益',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:chenyijin
	        	                },
	        	                {
	        	                    name:'平台费收益',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:pingtaifei
	        	                },
	        	                {
	        	                    name:'充值金额',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:chongzhi
	        	                },
	        	                {
	        	                    name:'提现金额', 
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:tixian
	        	                },
	        	                {
	        	                    name:'视屏收益',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:shipingfei
	        	                },
	        	                {
	        	                    name:'报名人数',
	        	                    type:'line',
	        	                    stack: '总量',
	        	                    data:baominshu
	        	                }
	        	            ]
	        	        };
	        	        // 使用刚指定的配置项和数据显示图表。
	        	        myChart.setOption(option);
        			}else if(result.code==200){
        				
        			}else if(result.code==300){
        				 //登录时间过期
          			  layer.msg('登录信息过期，请重新登录',{
     						icon: 1,
     						time: 1000 //2秒关闭（如果不配置，默认是3秒）
     						}, function(){
     							parent.location.href = "login.html";
     						});
        			}
        		}
        	});
        });
    </script>
    <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
        </script>
    </body>
</html>